<%@page contentType="text/html" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="<%=application.getContextPath()%>/nresources/ued/css/all-src.css" type="text/css" rel="stylesheet"/>
    <title>菜单使用记录</title>
    <%@include file="/WEB-INF/ibnms/common/jqgrid.jsp" %>
    <style type="text/css">
        select {
            width: auto;
        }
    </style>
</head>
<body>
<div class="form-wrapper">
    <div class="form-title">
        <span class="ttcorner"></span>

        <h3>
            <span class="text">菜单使用记录统计</span>
        </h3>
    </div>
    <form name="theForm">
        <input type="hidden" name="userForm.DEPT_ID" value="${userForm.DEPT_ID}"/>
    </form>
    <div class="box-in">
    </div>
    <div class="title-style"><a class="fold-tip"></a></div>
    <div class="block02">
        <table id="gridTable">
        </table>
        <div id="gridPager">
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="<%=application.getContextPath()%>/njs/basd/common/commons.min.js"></script>
<script type="text/javascript" src="<%=application.getContextPath()%>/njs/basd/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
    $(function () {
        $(".title-style a.fold-tip").toggle(toggletip, toggletip);
        function toggletip() {
            if ($(this).attr("class").split("unfold-tip").length > 1) {
                $(this).removeClass("unfold-tip");
                $(this).parents().prev(".box-in").show("fast");
            } else {
                $(this).addClass("unfold-tip");
                $(this).parents().prev(".box-in").hide("fast");
            }
        }
    });

    $(function () {
        $("#gridTable").jqGrid({
            url: "<s:url action="moduleUseCountJson" namespace="/ibnms/report"/>",
            datatype: "json",
            mtype: "POST",
            height: "100%",
            autowidth: true,
            sortname:'USE_COUNT',
            sortorder:'desc',
            colNames: ['菜单id','菜单名', '菜单层级', '使用次数','使用用户数'],
            colModel: [
                {name: 'moduleId', index: 'MODULE_ID',hidden:true},
                {name: 'moduleName', index: 'MODULE_NAME',sortable:false},
                {
                    name: 'moduleDirectory',width:'300px', index: 'MODULE_DIRECTORY',sortable:false
                },
                {
                    name: 'useCount', index: 'USE_COUNT',sortable:true
                },
                {
                    name: 'useUserCount', index: 'USE_USER_COUNT',sortable:true
                }
            ],
            sortable:true,
            viewrecords: true,
            rowNum: 10,
            rowList: [10, 20, 30],
            jsonReader: {
                root: 'rows',
                page: 'page',
                total: 'total',
                records: 'records',
                repeatitems: false,
                subgrid: {
                    root: 'rows',
                    page: 'page',
                    total: 'total',
                    records: 'records',
                    repeatitems: false
                }
            },
            pager: "#gridPager",
            hidegrid: true,
            multiselect: true,
            beforeRequest: function () {
                var postData = {
                    "queryRule": $("#queryTimeRule").val(),
                    "beginTime": $("input[name=chooseTime]:visible").val(),
                    "endTime": $("#lastDate").val()
                };
                $.extend($("#gridTable").getGridParam("postData"), postData);
            }
        });
    });
</script>
</html>
